import axios from './api' // 倒入 api
import config from './config.js' // 倒入默认配置
export const BASEURL = config.baseURL

/* 将所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 */

export const IMAGEPATH = BASEURL + 'crm'

// 跟进客户-标记为第三方产品
export const SAVE_THIRD_PARTY = (params) => {
  return axios({
    url: 'my/customer/label/third/party',
    method: 'GET',
    params
  })
}

// 跟进客户-获取所有客户标签
export const GET_ALL_LABEL = (params) => {
  return axios({
    url: 'label/all',
    method: 'GET',
    params
  })
}

// 新增签约-电子签约
export const SAVE_CONTRACT_ESIGN = (params) => {
  return axios({
    url: '/my/customer/contract/esign',
    method: 'POST',
    data: params
  })
}

// 客户管理-第三方客户
export const GET_THIRD_PARTY_LIST = (params) => {
  return axios({
    url: 'customer/third/party/page',
    method: 'POST',
    data: params
  })
}

// 合作机构-合作公司-获取列表
export const GET_THIRD_PARTY_PAGE = (params) => {
  return axios({
    url: 'third/party/page',
    method: 'POST',
    data: params
  })
}

// 合作机构-合作公司-获取所有的合作公司
export const GET_THIRDPARTY_ALLPAGE = (params) => {
  return axios({
    url: 'third/party/all',
    method: 'GET',
    params
  })
}

// 合作机构-合作公司-新增合作公司
export const ADD_THIRD_PARTY_INFO = (params) => {
  return axios({
    url: 'third/party/add',
    method: 'POST',
    data: params
  })
}

// 合作机构-合作公司-编辑合作公司
export const UPDATE_THIRD_PARTY_INFO = (params) => {
  return axios({
    url: 'third/party/update',
    method: 'POST',
    data: params
  })
}

// 合作机构-合作公司客户-获取列表
export const GET_THIRDPARTY_CUSTOMER_LIST = (params) => {
  return axios({
    url: 'third/party/customer/page',
    method: 'POST',
    data: params
  })
}

// 合作机构-合作公司客户-分配给第三方公司
export const ALLOT_THIRDPARTY_CUSTOMER_INFO = (params) => {
  return axios({
    url: 'customer/third/party/dis',
    method: 'POST',
    data: params
  })
}

// 系统管理-标签管理-获取所有的标签
export const GET_ALL_TAGS_LIST = (params) => {
  return axios({
    url: 'label/all',
    method: 'GET',
    params
  })
}

// 系统管理-标签管理-删除标签
export const DEL_TAGS_INFO = (params) => {
  return axios({
    url: 'label/del',
    method: 'POST',
    data: params
  })
}

// 系统管理-标签管理-添加标签
export const ADD_TAGS_INFO = (params) => {
  return axios({
    url: 'label/add',
    method: 'POST',
    data: params
  })
}

// 系统管理-公司信息-获取配置
export const GET_ORGCONFIG_INFO = (params) => {
  return axios({
    url: 'org/config/get',
    method: 'GET',
    params
  })
}


// 系统管理-公司信息-修改配置
export const UPDATE_ORGCONFIG_INFO = (params) => {
  return axios({
    url: 'org/config/update',
    method: 'POST',
    data: params
  })
}

// 客户管理-加入公共池
export const ADD_CUSTOMER_POOL = (params) => {
  return axios({
    url: '/my/customer/add/pool',
    method: 'POST',
    data: params
  })
}

// 客户管理-公共池导入
export const CUSTOMER_IMPORT_FILE = BASEURL + '/import/excel/customer'

// 客户管理-公共池导入-模板下载
export const DOWNLOAD_CUSTOMER_MODULEFILE = '/import_model.xlsx'

// 客户管理-公共池-删除客户
export const DELETE_PUBLICPOOL_CUSTOMER = (params) => {
  return axios({
    url: '/customer/public/del',
    method: 'POST',
    data: params
  })
}

// 客户管理-公共池-领取客户
export const GET_PUBLICPOOL_CUSTOMER = (params) => {
  return axios({
    url: '/customer/public/get',
    method: 'POST',
    data: params
  })
}

// 生成二维码
export const GET_ORG_QRCODE = (params) => {
  return axios({
    url: '/org/qrcode',
    method: 'POST',
    data: params
  })
}

// 登记
export const SAVE_ORG_CUSTOMER = (params) => {
  return axios({
    url: '/org/dengji',
    method: 'GET',
    params
  })
}

// 获取休息状态
export const GET_REST_MODE = (params) => {
  return axios({
    url: '/switch/get',
    method: 'GET',
    params
  })
}

// 更新休息状态
export const UPDATE_REST_MODE = (params) => {
  return axios({
    url: '/switch/state',
    method: 'GET',
    params
  })
}

// 离职回收客户
export const UPDATE_EMPLOYEE_STATE = (params) => {
  return axios({
    url: '/employee/state',
    method: 'GET',
    params
  })
}
// 删除员工
export const DELETE_EMPLOYEE_STATE = (params) => {
  return axios({
    url: '/employee/del',
    method: 'GET',
    params
  })
}

// 上门登记分页列表
export const GET_ALL_CUSSTOMER = (params) => {
  return axios({
    url: '/customer/all/page',
    method: 'POST',
    data: params
  })
}

// 上门登记分页列表
export const GET_REGISTER_CUSSTOMER = (params) => {
  return axios({
    url: '/customer/register/page',
    method: 'POST',
    data: params
  })
}

// 已删除分页列表
export const GET_DELETE_CUSSTOMER = (params) => {
  return axios({
    url: '/customer/del/page',
    method: 'POST',
    data: params
  })
}

// 获取客户详情
export const GET_CUSSTOMER_INFO = (params) => {
  return axios({
    url: '/my/customer/info',
    method: 'GET',
    params
  })
}

// 客户星级标记
export const SAVE_CUSTOMER_LABEL = (params) => {
  return axios({
    url: '/customer/modify/label',
    method: 'POST',
    data: params
  })
}

// 团队客户管理-预约列表
export const GET_APPOINTMENT_LIST = (params) => {
  return axios({
    url: '/appointment/page',
    method: 'POST',
    data: params
  })
}

// 团队客户管理-新增预约
export const ADD_APPOINTMENT_INFO = (params) => {
  return axios({
    url: '/appointment/add',
    method: 'POST',
    data: params
  })
}

// 未跟进客户统计-全部客户
export const GET_CUSTOMER_STATISTICS = (params) => {
  return axios({
    url: '/customer/statistics',
    method: 'POST',
    data: params
  })
}

// 未跟进客户统计-团队客户
export const GET_CUSTOMER_STATISTICS_TEAM = (params) => {
  return axios({
    url: '/customer/statistics/team',
    method: 'POST',
    data: params
  })
}

// 未跟进客户统计-成交客户
export const GET_CUSTOMER_STATISTICS_COMPLETE = (params) => {
  return axios({
    url: '/customer/statistics/complete',
    method: 'POST',
    data: params
  })
}

// 未跟进客户统计-锁定客户
export const GET_CUSTOMER_STATISTICS_LOCK = (params) => {
  return axios({
    url: '/customer/statistics/lock',
    method: 'POST',
    data: params
  })
}

// 锁定客户
export const SAVE_CUSTOMER_LOCK = (params) => {
  return axios({
    url: '/my/customer/lock',
    method: 'POST',
    data: params
  })
}

// 导出排重包
export const EXPORT_CUSTOMER_PCH = (params) => {
  return axios({
    url: '/org/export/pch',
    method: 'GET',
    params
  })
}

// 我的客户-获取锁定客户
export const GET_LOCK_CUSTOMER = (params) => {
  return axios({
    url: '/my/customer/lock/page',
    method: 'POST',
    data: params
  })
}

// 团队客户-获取团队锁定客户
export const GET_TEAM_LOCK_CUSTOMER = (params) => {
  return axios({
    url: '/customer/lock/page',
    method: 'POST',
    data: params
  })
}

// 团队客户-获取全部客户
export const GET_TEAM_ALL_CUSTOMER = (params) => {
  return axios({
    url: '/customer/all/page2',
    method: 'POST',
    data: params
  })
}

// 已完成客户列表
export const GET_ALL_COMPLETE_CUSTOMER = (params) => {
  return axios({
    url: '/customer/complete/page',
    method: 'POST',
    data: params
  })
}

// 未跟进客户统计-全部客户
// export const GET_CUSTOMER_STATISTICS = (params) => {
//   return axios({
//     url: '/customer/statistics',
//     method: 'POST',
//     data: params
//   })
// }
